/**
 * Company : SIANGKLOM.
 * Created By : Chatree Siangklom
 * Created On : Aug 21, 2013  5:41:35 PM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : com.tis.database.entitys
 * File Name : AGenType.java
 * TODO
 */
package com.tis.database.entitys;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.*;

import org.apache.commons.lang.builder.ToStringBuilder;

import java.util.Date;


/**
 * The persistent class for the A_GEN_TYPE database table.
 * 
 */
@Entity
@Table(name="A_GEN_TYPE")
@NamedQueries({
    @NamedQuery(name = AGenType.findAll, query = "FROM AGenType c "),
    @NamedQuery(name = AGenType.findById, query = "FROM AGenType c WHERE  c.pkId = :pkId "),
    @NamedQuery(name = AGenType.findByCode, query = "FROM AGenType c WHERE  c.code = :code ")
    })
public class AGenType implements Serializable {
	private static final long serialVersionUID = 1L;

	public static final String findAll = "AGenType_findAll";
	public static final String findById = "AGenType_findById";
	public static final String findByCode = "AGenType_findByCode";
	
	@Id
	@Column(name="A_GEN_TYPE_ID")
	private BigDecimal pkId;

	@Column(name="CODE")
	private String code;

	@Column(name="CREATED_BY")
	private String createdBy;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATED_ON")
	private Date createdOn;

	@Column(name="DESCRIPTION")
	private String description;

	@Column(name="ISACTIVE")
	private String isactive;

	@Column(name="MSG_CODE")
	private String msgCode;

	@Column(name="MSG_DESC")
	private String msgDesc;

	@Column(name="NAME")
	private String name;

	@Column(name="STATUS")
	private String status;

	@Column(name="UPDATED_BY")
	private String updatedBy;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="UPDATED_ON")
	private Date updatedOn;

	public AGenType() {
		
	}
	
	public AGenType(BigDecimal pkId) {
		this.pkId = pkId;
	}
	
	/**
	 * @return the pkId
	 */
	public BigDecimal getPkId() {
		return pkId;
	}



	/**
	 * @param pkId the pkId to set
	 */
	public void setPkId(BigDecimal pkId) {
		this.pkId = pkId;
	}



	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getIsactive() {
		return this.isactive;
	}

	public void setIsactive(String isactive) {
		this.isactive = isactive;
	}

	public String getMsgCode() {
		return this.msgCode;
	}

	public void setMsgCode(String msgCode) {
		this.msgCode = msgCode;
	}

	public String getMsgDesc() {
		return this.msgDesc;
	}

	public void setMsgDesc(String msgDesc) {
		this.msgDesc = msgDesc;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getUpdatedOn() {
		return this.updatedOn;
	}

	public void setUpdatedOn(Date updatedOn) {
		this.updatedOn = updatedOn;
	}
	
	@Override
	public String toString()
	{
		return ToStringBuilder.reflectionToString(this);
	}



	/**
	 * @param pkId
	 * @param code
	 * @param createdBy
	 * @param createdOn
	 * @param description
	 * @param isactive
	 * @param msgCode
	 * @param msgDesc
	 * @param name
	 * @param status
	 * @param updatedBy
	 * @param updatedOn
	 */
	public AGenType(BigDecimal pkId, String code, String createdBy, Date createdOn,
			String description, String isactive, String msgCode,
			String msgDesc, String name, String status, String updatedBy,
			Date updatedOn) {
		this.pkId = pkId;
		this.code = code;
		this.createdBy = createdBy;
		this.createdOn = createdOn;
		this.description = description;
		this.isactive = isactive;
		this.msgCode = msgCode;
		this.msgDesc = msgDesc;
		this.name = name;
		this.status = status;
		this.updatedBy = updatedBy;
		this.updatedOn = updatedOn;
	}



	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		result = prime * result
				+ ((createdBy == null) ? 0 : createdBy.hashCode());
		result = prime * result
				+ ((createdOn == null) ? 0 : createdOn.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result
				+ ((isactive == null) ? 0 : isactive.hashCode());
		result = prime * result + ((msgCode == null) ? 0 : msgCode.hashCode());
		result = prime * result + ((msgDesc == null) ? 0 : msgDesc.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((pkId == null) ? 0 : pkId.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		result = prime * result
				+ ((updatedBy == null) ? 0 : updatedBy.hashCode());
		result = prime * result
				+ ((updatedOn == null) ? 0 : updatedOn.hashCode());
		return result;
	}



	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof AGenType)) {
			return false;
		}
		AGenType other = (AGenType) obj;
		if (code == null) {
			if (other.code != null) {
				return false;
			}
		} else if (!code.equals(other.code)) {
			return false;
		}
		if (createdBy == null) {
			if (other.createdBy != null) {
				return false;
			}
		} else if (!createdBy.equals(other.createdBy)) {
			return false;
		}
		if (createdOn == null) {
			if (other.createdOn != null) {
				return false;
			}
		} else if (!createdOn.equals(other.createdOn)) {
			return false;
		}
		if (description == null) {
			if (other.description != null) {
				return false;
			}
		} else if (!description.equals(other.description)) {
			return false;
		}
		if (isactive == null) {
			if (other.isactive != null) {
				return false;
			}
		} else if (!isactive.equals(other.isactive)) {
			return false;
		}
		if (msgCode == null) {
			if (other.msgCode != null) {
				return false;
			}
		} else if (!msgCode.equals(other.msgCode)) {
			return false;
		}
		if (msgDesc == null) {
			if (other.msgDesc != null) {
				return false;
			}
		} else if (!msgDesc.equals(other.msgDesc)) {
			return false;
		}
		if (name == null) {
			if (other.name != null) {
				return false;
			}
		} else if (!name.equals(other.name)) {
			return false;
		}
		if (pkId == null) {
			if (other.pkId != null) {
				return false;
			}
		} else if (!pkId.equals(other.pkId)) {
			return false;
		}
		if (status == null) {
			if (other.status != null) {
				return false;
			}
		} else if (!status.equals(other.status)) {
			return false;
		}
		if (updatedBy == null) {
			if (other.updatedBy != null) {
				return false;
			}
		} else if (!updatedBy.equals(other.updatedBy)) {
			return false;
		}
		if (updatedOn == null) {
			if (other.updatedOn != null) {
				return false;
			}
		} else if (!updatedOn.equals(other.updatedOn)) {
			return false;
		}
		return true;
	}

	
}